package rsj.domain;

public class ProductPageQuery{
    private String prodName;
    private String prodType;
    private String orgId;
    private String prodStatus;

    private int isAllQuery = 0;// 0是全量产品查询  1是条件查询
    private long pageCount;
    private int pageSize;
    private long offset;
    private long limit;
    public String getProdName() {
        return prodName;
    }

    public void setProdName(String prodName) {
        this.prodName = prodName;
    }

    public String getProdType() {
        return prodType;
    }
    public long getPageCount() {
        if (pageCount <= 0) {
            pageCount = 1;
        }
        return (pageCount - 1) * pageSize;
    }

    public void setPageCount(long pageCount) {
        this.pageCount = pageCount;
    }

    public int getPageSize() {
        if (pageSize <= 0) {
            pageSize = 20;
        }
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public void setProdType(String prodType) {
        this.prodType = prodType;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getProdStatus() {
        return prodStatus;
    }

    public void setProdStatus(String prodStatus) {
        this.prodStatus = prodStatus;
    }

    public boolean getIsAllQuery() {
        return isAllQuery == 1;
    }

    public void setIsAllQuery() {
        this.isAllQuery = 1;
    }

    public void setIsProdQuery() {
        this.isAllQuery = 0;
    }

    public long getOffset() {
        return getPageCount();
    }

    public long getLimit() {
        return getPageSize();
    }
}
